﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Machine.Specifications;
using SportsStore.DataBaseInfrastructure;
using Raven.Client;
using NUnit.Framework;

namespace SportsStore.DatabaseInfraStructure.Test.Common
{
	public class When_I_Request_The_Database_Connection_For_The_Second_time
	{
		static IDataBase Database;
		static IDocumentStore databaseStore1;
		static IDocumentStore databaseStore2;

		Establish context = () => 
		{
			Database = new RavenDataBaseConnection(@"http://localhost:8080");
		};

		Because i_Dont_Want_Create_Multiple_Object_Of_Connection = () => 
		{
			databaseStore1=Database.Connect();
			databaseStore2 = Database.Connect();
		};

		It Should_Return_Same_Object = () => 
		{
			databaseStore1.ShouldBeTheSameAs(databaseStore2);
		};
	}
}
